package com.zp.recoder2;

import com.zp.recoder01.MySqlSaveOrderStrategy;
import com.zp.recoder01.NoSqlSaveOrderStrategy;
import com.zp.recoder01.OrderServiceExecutor;
import com.zp.vo.User;

public class Recoder2Test {
    public static void main(String[] args) {
        AbstractPushTemplate template1 = new PushCouponTemplate();
        template1.push(1, "糖果店");

        AbstractPushTemplate template2 = new PushScoreTemplate();
        template2.push(1, "服装店");
    }

    /**
     * 重构后
     */
    public static void recoder() {
        new PushTemplateLambda().push(1, "糖果店", (Object[] obj) -> {
            System.out.println("会员:" + obj[0] + ",你好，" + obj[1] + "送您一张优惠券");
        });

        new PushTemplateLambda().push(1, "服装店", (Object[] obj) -> {
            System.out.println("会员:" + obj[0] + ",你好，" + obj[1] + "送您10个积分");
        });

        new PushTemplateLambda().push2(new User(),user ->{
            System.out.println(user);
        });
    }
}